<template>
	<view>
			<image
				src="https://cdn.nlark.com/yuque/0/2019/gif/280373/1551683512059-assets/web-upload/57ec0f74-dc1a-4618-be1d-75c8e00311c0.gif"
				mode="widthFix"
				class="response"
			></image>
	

		<view class="cu-card " v-for="car in carList" >
			<view class="cu-item " :data-num="car.id" @click="getCar">
				<view class="text-bold text-black">
					{{car.stop_time}}
				</view>
				<view class="grid col-3 text-center cu-card bg-yellow">
					<view class="flex flex-direction align-end ">
						<view class="margin-xs text-sl">{{car.start_time}}</view>
						<view class="flex margin-right-sm text-black text-xl text-content">
							{{car.start_station}}
							<!-- <view class="cuIcon-safe margin-lr-sm text-l"></view> -->
						</view>
					</view>

					<view class="flex flex-direction shadow-blur align-center  ">
						<view class="flex  margin-sm">
							<view class="cuIcon-global margin-xs"></view>
							<view class="solid-bottom text-bold">{{car.car_number}}</view>
							<view class="cuIcon-send margin-xs line-green"></view>
						</view>
						<view class="cf">
							<view class="fl solid-right">准载{{car.passenger_num}}人</view>
							<view class="fr text-red solid-left">剩余{{car.passenger_true}}人</view>
						</view>
					</view>

					<view class="flex align-start flex-direction radius ">
						<view class="margin-xs text-sl text-black">{{car.end_time}}</view>
						<view class="flex margin-lr-sm text-black text-xl">
							<!-- <view class="cuIcon-safe margin-right-sm "></view> -->
							{{car.end_station}}
						</view>
					</view>
				</view>
			</view>
		</view>

		<!-- <view class="cu-card ">
			<view class="cu-item">
				<view class="grid col-3 text-center cu-card bg-gradual-blue">
					<view class="flex flex-direction align-end ">
						<view class="margin-xs text-sl">16:00</view>
						<view class="flex margin-right-sm text-black text-xl">
							火车站
							<view class="cuIcon-safe margin-lr-sm text-l"></view>
						</view>
					</view>

					<view class="flex flex-direction shadow-blur  ">
						<view class="flex align-center justify-center margin-sm">
							<view class="cuIcon-global margin-xs"></view>
							<view class="solid-bottom text-bold">GH8003</view>
							<view class="cuIcon-send margin-xs line-green"></view>
						</view>
						<view class="cf">
							<view class="fl solid-right">准载45人</view>
							<view class="fr text-red solid-left">剩余45人</view>
						</view>
					</view>

					<view class="flex align-start flex-direction radius ">
						<view class="margin-xs text-sl text-black">19:00</view>
						<view class="flex margin-lr-sm text-black text-xl">
							<view class="cuIcon-safe margin-right-sm "></view>
							磨家
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="cu-card ">
			<view class="cu-item">
				<view class="grid col-3 text-center cu-card ">
					<view class="flex flex-direction align-end ">
						<view class="margin-xs text-sl">16:00</view>
						<view class="flex margin-right-sm text-black text-xl">
							火车站
							<view class="cuIcon-safe margin-lr-sm text-l"></view>
						</view>
					</view>

					<view class="flex flex-direction shadow-blur  ">
						<view class="flex align-center justify-center margin-sm">
							<view class="cuIcon-global margin-xs"></view>
							<view class="solid-bottom text-bold">GH8003</view>
							<view class="cuIcon-send margin-xs line-green"></view>
						</view>
						<view class="cf">
							<view class="fl solid-right">准载45人</view>
							<view class="fr text-red solid-left">剩余45人</view>
						</view>
					</view>

					<view class="flex align-start flex-direction radius ">
						<view class="margin-xs text-sl text-black">19:00</view>
						<view class="flex margin-lr-sm text-black text-xl">
							<view class="cuIcon-safe margin-right-sm "></view>
							磨家
						</view>
					</view>
				</view>
			</view>
		</view>-->
	</view> 
</template>

<script>
	var _self;
export default {
	data() {
		return {
			carList:{},
			
		};
	},
	onLoad: function() {
		_self =this;
		
		uni.request({
			url: 'http://caradmin.cn/car/index/gettaskList',
			method: 'GET',
			data: {},
			success: res => {
				_self.carList =res.data.data;
				console.log(res.data.data);
			},
			fail: () => {},
			complete: () => {}
		});
		

		
		// 	uni.getSetting({
		// 	success: res => {
  //              console.log(res);
  //           if (res.authSetting['scope.userInfo'] === true) {
		// 		global.wxLogin();
		// 		}else{
		// 			uni.navigateTo({
		// 		url: '../login/login'
		// 	});
		// 		}
		// 	}
		// });
		
	},
	methods: {
		getCar:function(e){
			var num = e.currentTarget.dataset.num;
			// console.log(num);
			uni.navigateTo({
				url:"../content/content?num="+num
			});
		}
	}
};
</script>

<style>

</style>
